#!/usr/bin/env node

const Koa = require('koa'),
      log = console.log;
const app = new Koa();

// M-logger
app.use((ctx,next)=>{
  let start = Date.now();
  next();
  let end = Date.now();
  log(`${ctx.method} ${ctx.path} cost:${end-start}ms`);
});

app.use((ctx,next)=>{   //M-hello
  ctx.body = 'hello koa';

});

app.listen(8080);
